<?php
	
	$encodedValue 	= "";
	$msgValue 	= "";

	if( isset( $_POST['generate'] ) ) 
	{
		$msgValue = $_POST['generate'];

		if( strlen( $_POST['uservalue'] ) != 0 )
		{
			$encodedValue = md5( $_POST['uservalue'] );
	    }

		unset( $_POST['generate'] );
	}
    
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/RT/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<link rel="stylesheet" type="text/css" title="default" href="css/style.css"/ >
<title>MD5 Encoding</title>
</head>

<body>
<img src="img/arkalogo.png" alt="Arka Roy Consulting" title="Arka Roy Consulting" />

<table align="center" cellspacing="0">
	<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
	<tr>
		<td colspan="2">
			<h1>MD5 Encoding</h1>
		</td>
	</tr>
	<tr>
		<th align="left">
			Value to encode
		</th>
		<td align="right">
			<input name="uservalue" style='width:600px;' />
		</td>
	</tr>
	<tr>
		<th align="left">
			Encoding result
		</th>
		<td align="right">
			<input name="encodedvalue" value="<?php echo $encodedValue ?>"  style='width:600px;' readonly />
		</td>
	</tr>
	<tr>
		<th align="left">
			Message text
		</th>
		<td align="right">
			<input name="messagetext" value="<?php echo $msgValue ?>"  style='width:600px;' readonly />
		</td>
	</tr>
	<tr>
		<td colspan="2" align="center">
			<input type="submit" name="generate" value="Generate" />
		</td>
	</tr>
	</form>
</table>

</body>

</html>


